<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>weather</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script>
        //关注请求方式，请求地址，携带参数，响应数据
        $.ajax({
            type:'get',
            url:'http://localhost:8080/Weather',
            data:{
                appkey:'51d354810b136f5dc9a01a4260e4c6c3',
                city:'柳州'
            },
            //响应的数据
            success:function(res){
                   console.log(res);
                   console.log(res.data);
                var obj = JSON.parse(res.data);
                console.log(obj);
                // console.log(obj);
                 console.log(obj.result.result.city);
                 console.log(obj.result.result.date);
                 console.log(obj.result.result.temphigh);
                 console.log(obj.result.result.templow);
                 $('body').append('<div>'+obj.result.result.city+'</div>');
                 $('body').append(`<div>${obj.result.result.date}</div>`);
                 $('body').append(`<div>${obj.result.result.temphigh}</div>`);
                 $('body').append(`<div>${obj.result.result.templow}</div>`);
             },
            error:function(erro){
                //    console.log(erro);
            }
        })
    </script>
</head>
<body>

</body>
</html>